﻿/**********************************天使物流*******************************************
* 功能描述:基本信息-外协单位
* 作者:李周蓬
* 时间:
* 
**********************************天使物流*******************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TianShiProject.Models.BaseInfo.Outsources;
using TianShiProject.Models.Common;
using Volo.Abp.Application.Services;

namespace TianShiProject.BaseInfo.Outsources
{
    public class OutsourceService : ApplicationService
    {
        private readonly IOutsourceRepository _outsourceRepository;
        public OutsourceService(IOutsourceRepository outsourceRepository)
        {
            _outsourceRepository = outsourceRepository;
        }
        /// <summary>
        /// 显示外协单位
        /// </summary>
        /// <param name="name"></param>
        /// <param name="phone"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public async Task<PageResponse<OutsourceDto>> GetShowOutsource(string name, string phone, int pageindex = 1, int pagesize = 3)
        {
            return await _outsourceRepository.GetShowOutsource(name, phone, pageindex, pagesize);
        }
        /// <summary>
        /// 删除外协单位
        /// </summary>
        /// <returns></returns>
        public async Task<int> DeleteDelOutsource(int id)
        {
            return await _outsourceRepository.DeleteDelOutsource(id);
        }
        /// <summary>
        /// 批量删除外协单位
        /// </summary>
        /// <returns></returns>
        public async Task<int> DeleteDelsOutsource(string ids)
        {
            return await _outsourceRepository.DeleteDelsOutsource(ids);
        }
        /// <summary>
        /// 编辑修改
        /// </summary>
        /// <param name="OutsourceDto"></param>
        /// <returns></returns>
        public async Task<int> PutUpdateOutsource(OutsourceDto outsourceDto)
        {
            return await _outsourceRepository.PutUpdateOutsource(outsourceDto);
        }
        /// <summary>
        /// 添加外协单位
        /// </summary>
        /// <param name="OutsourceDto"></param>
        /// <returns></returns>
        public async Task<int> PostAddOutsource(OutsourceDto outsourceDto)
        {
            return await _outsourceRepository.PostAddOutsource(outsourceDto);
        }
    }
}
